﻿@{
    Layout = null;
}
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0" />
<link href="~/Scripts/Bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<style>
    ul li
    {
        list-style: none;
        border-bottom: 1px solid rgb(128, 128, 128);
        padding: 10px;
    }

</style>

<div class="col-xs-12 col-sm-12	col-md-12 col-lg-12">
    <div id="TopNav">
        <div class="row">
            <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 text-right" style="color:#999999">
                产品批次号:
            </div>
            <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
            </div>
        </div>
        <div class="row">
            <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 text-right" style="color:#999999">
                产品名称:
            </div>
            <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
            </div>
        </div>
    </div>
    <div id="Title">
        <div style="margin: 0 auto; color: #4caf50;background:#FFFFFF;width:35%;text-align:center;font-size:16px;position:relative;z-index:1">添加任务信息</div>
        <div style="border: 1px solid #4caf50;margin-top:-12px; "></div>
    </div>
    <div id="AddInfo">
        <h1>播种</h1>
        <div class="row" style="margin-bottom:15px">
            <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">图片</div>
            <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                <img id="Img" src="/Content/userImgs/Product/ProductNullImg.png" style="height:55px;width:55px">
                <button class="btn btn-success" id="picker1">
                    <i class="glyphicon glyphicon-picture"></i>
                </button>

                <input type="hidden" id="ImgUrl" value="" />
            </div>
        </div>

        <div class="row" style="margin-bottom:15px">
            <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">视频</div>
            <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                <img id="video" src="/Content/userImgs/Product/ProductNullImg.png" style="height:55px;width:55px">
                <button class="btn btn-success" id="picker2">
                    <i class="glyphicon glyphicon-picture"></i>
                </button>

                <input type="hidden" id="VideoUrl" value="" />
            </div>
        </div>




        <div class="row" style="margin-bottom:15px">
            <div class=" col-xs-3 col-sm-3 col-md-3 col-lg-3">节点内容</div>
            <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                <textarea id="NodeContent" class="form-control" placeholder=""></textarea>
            </div>
        </div>
    </div>
    <div class="row" id="bottomRow" style="border-top: 1px solid #E5E5E5; margin: 0; padding-top: 10px;padding-bottom: 30px; position: fixed; bottom: 0; width: calc(100% - 30px); ">
        <div class=" col-xs-3 col-sm-3 col-md-3 col-lg-3">
            <img src="/Content/userImgs/Product/ProductNullImg.png" style="height:55px;width:55px">
        </div>

        <div class=" col-xs-9 col-sm-9 col-md-9 col-lg-9 FlowNodeUlLi">
            <div>老王</div>
            <div>
                操作人：admin
            </div>
            <div>
                18221196274
            </div>
        </div>
    </div>
</div>


                   <input type="button" class="btn-green" id="NodeSave"/>


@*<script src="~/Scripts/jquery.js"></script>*@
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<link href="~/Scripts/WebUploader/webuploader.css" rel="stylesheet" />
@*<script src="~/Scripts/WebUploader/webuploader.js"></script>*@
<script src="~/Scripts/WebUploader/webuploader.min.js"></script>


<script type="text/javascript">

    $(document).ready(function () {

        Binding(nodeId);





    });

    function Binding() {

        $.ajax({
            type: "POST",
            url: "/OriginsNode/GetNodeModel",
            dataType: 'json',
            data: { nodeId:$("#nodeId").val() },
            success: function (data) {



            },
            error: function (e) {
                $.L.msgError("network error");
            }
        });




    }

  
    $("#NodeSave").click(function () {



        $.ajax({
            type: "POST",
            url: "/OriginsNode/NodeSave",
            dataType: 'json',
            data: { batchId: batchId },
            success: function (data) {


                 
            },
            error: function (e) {
                $.L.msgError("network error");
            }
        });






    });


</script>






<script>

    $(function () {

        var uploader1 = WebUploader.create({
            // swf文件路径
            //swf: BASE_URL + '/js/Uploader.swf',
            // 文件接收服务端。
            server: '/OriginsMaterial/Upload',
            // 选择文件的按钮。可选。 内部根据当前运行是创建，可能是input元素，也可能是flash.
            pick: {
                id: '#picker1',
                multiple: false
            },
            accept: {
                title: 'Images',
                extensions: 'gif,jpg,jpeg,bmp,png',
                mimeTypes: 'image/jpg,image/jpeg,image/png'
            },
            // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
            resize: false
        });


        var uploader2 = WebUploader.create({
            // swf文件路径
            //swf: BASE_URL + '/js/Uploader.swf',
            // 文件接收服务端。
            server: '/OriginsMaterial/Upload',
            // 选择文件的按钮。可选。 内部根据当前运行是创建，可能是input元素，也可能是flash.
            pick: {
                id: '#picker2',
                multiple: false
            },
            accept: {
                title: 'Images',
                extensions: 'mp4',
                mimeTypes: 'video/mpeg,video/mp4'
            },
            // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
            resize: false
        });



        function LoadItem(item, selector) {

            item.on('fileQueued', function (file) {
                item.upload();
            });

            item.on('uploadSuccess', function (file, r) {
                var result = r._raw.split("。")[1];
                if (selector == "#picker1") {
                    $("#Img").attr("src", result);
                    $("#ImgUrl").val(result);
                }
                if (selector == "#picker2") {
                    $("#VideoUrl").val(result);
                }
            });

            item.on('uploadError', function (file) {
                $.L.msgError("上传出错");
            });


        }


        LoadItem(uploader1, "#picker1");
        LoadItem(uploader2, "#picker2");


    });





</script>